<html>
<head><meta charset="utf-8"><title>cfnts · wg-secure-code · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/index.html">wg-secure-code</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html">cfnts</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="179671535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179671535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Gaynor <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179671535">(Nov 01 2019 at 22:34)</a>:</h4>
<p><a href="https://github.com/cloudflare/cfnts" target="_blank" title="https://github.com/cloudflare/cfnts">https://github.com/cloudflare/cfnts</a> - exactly one <code>unsafe</code> block. Nice to see how tractable that is for real-world code</p>



<a name="179672353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179672353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179672353">(Nov 01 2019 at 22:49)</a>:</h4>
<p>Nice! There is actually a bunch of examples like that - <a href="https://github.com/Frommi/miniz_oxide" target="_blank" title="https://github.com/Frommi/miniz_oxide">https://github.com/Frommi/miniz_oxide</a> is 100% safe and faster than the C version, <a href="https://github.com/RustAudio/lewton" target="_blank" title="https://github.com/RustAudio/lewton">https://github.com/RustAudio/lewton</a> is 100% safe and is within 5% performance difference compared to reference C library</p>



<a name="179675407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179675407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179675407">(Nov 01 2019 at 23:58)</a>:</h4>
<p>Beating C on performance seems to be pretty easy</p>



<a name="179675410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179675410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179675410">(Nov 01 2019 at 23:58)</a>:</h4>
<p>it was really funny installing <code>loc</code></p>



<a name="179675415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179675415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179675415">(Nov 01 2019 at 23:58)</a>:</h4>
<p><code>cloc</code> was taking... I dunno, 30s+ on a particular directory</p>



<a name="179675416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179675416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179675416">(Nov 01 2019 at 23:58)</a>:</h4>
<p><code>loc</code> was instant</p>



<a name="179675715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179675715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179675715">(Nov 02 2019 at 00:06)</a>:</h4>
<p>Depends on the code. Some C libs are heavily optimized. Use cases also matter. For example, for my use cases (searching through 10,000 XML files, 11Gb total) <code>grep</code> is still considerably faster than <code>ripgrep</code></p>



<a name="179684978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179684978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179684978">(Nov 02 2019 at 04:29)</a>:</h4>
<p>IIRC cloc is written in perl, not c. taking a look, that seems to still be true</p>



<a name="179702888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179702888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shnatsel <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179702888">(Nov 02 2019 at 13:40)</a>:</h4>
<p>Also <a href="https://github.com/RazrFalcon/resvg" target="_blank" title="https://github.com/RazrFalcon/resvg">https://github.com/RazrFalcon/resvg</a> and its dependencies are very fast and only use <code>unsafe</code> where there are truly no mechanisms to get the job done safely.</p>



<a name="179717361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179717361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179717361">(Nov 02 2019 at 20:26)</a>:</h4>
<blockquote>
<p><code>cloc</code> was taking... I dunno, 30s+ on a particular directory</p>
</blockquote>
<p><span class="user-mention" data-user-id="132721">@Tony Arcieri</span> <code>cloc</code> is a giant perl script, so it's always going to be pretty slow. If you're interested in code counter performance comparisons, I also write one of these tools and did comparison on each's performance (Though this isn't the most up to date) <a href="https://github.com/XAMPPRocky/tokei/blob/master/COMPARISON.md" target="_blank" title="https://github.com/XAMPPRocky/tokei/blob/master/COMPARISON.md">https://github.com/XAMPPRocky/tokei/blob/master/COMPARISON.md</a></p>



<a name="179728263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146229-wg-secure-code/topic/cfnts/near/179728263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tony Arcieri <a href="https://rust-lang.github.io/zulip_archive/stream/146229-wg-secure-code/topic/cfnts.html#179728263">(Nov 03 2019 at 02:26)</a>:</h4>
<p><span class="user-mention" data-user-id="219696">@XAMPPRocky</span> neat!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>